﻿namespace Borg.AttributeAnalyze.Result
{
    public class DuplicatedSlotName : ResultBase
    {
        private readonly SlotDefinition _slotDefinition1;
        private readonly SlotDefinition _slotDefinition2;

        public DuplicatedSlotName(SlotDefinition slotDefinition1, SlotDefinition slotDefinition2)
            : base(slotDefinition1.Assembly, Component.SlotDefinition, ResultType.DuplicatedSlotname, slotDefinition1, null)
        {
            _slotDefinition1 = slotDefinition1;
            _slotDefinition2 = slotDefinition2;
        }

        public override string ToMsBuildMessageString()
        {
            return string.Format(
                "multiple slotdefinition\n{0}slot name: {1}\n{0}interface 1: {2}\n{0}interface 2: {3}",
                new object[] { GetWhiteSpace(2), Name, _slotDefinition1.TypeName, _slotDefinition2.TypeName });
        }

        public override MessageType MessageType
        {
            get { return MessageType.Error; }
        }
    }
}

